﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MS.InformationManagement.Presenter.Support;
using MS.InformationManagement.Presenter.InsertarRadicado;
using MS.InformationManagement.BLL.ReasignarDocumento;

namespace MS.InformationManagement.Presenter.ReasignarDocumento
{
    public class ReasignarDocumentoPresenter : BasePresenter<IReasignarDocumentoView>
    {
        #region Constructors

        public ReasignarDocumentoPresenter(IReasignarDocumentoView view) : base(view) { }

        #endregion

        #region Methods

        public void HandleLoad()
        {
            if (!string.IsNullOrEmpty(View.CurrentListId))
            {
                View.listUsuariosDepartamento = new MS.InformationManagement.BLL.ReasignarDocumento.ReasignarDocumento().GetUsersByDepartment();
            }
            View.Show();
        }

        public void HandleSave()
        {
            if (View.CurrentItemsId != null && View.CurrentItemsId != null && View.LoginName != null)
            {
                View.RadicadoMove = new MS.InformationManagement.BLL.ReasignarDocumento.ReasignarDocumento().MoveRadicado(View.CurrentListId, View.LoginName, View.CurrentItemsId);
                View.Success();
            }
        }

        #endregion
    }
}
